<?php
/**
 * Created by PhpStorm.
 * User: Akon
 * Date: 2016/12/14 0014
 * Time: 21:56
 */
namespace Manager\Controller;
use Think\Controller;
class AkonController extends Controller{
    /**GD**/
    public function imageInGd(){
        //读取文件
        $dir = "./Public/commonImage/";
        $fileArr = scandir($dir);
        /*
        foreach($fileArr as $k=>$v){
            if($v == '.' || $v == '..'){
                unset($fileArr[$k]);
            }
        }
        */
        //删除数组元素
        $key1 = array_search('.',$fileArr);
        $Key2 = array_search('..',$fileArr);
        if($key1 !== false || $key2 !== false){
            array_splice($fileArr,$key1,1);
            array_splice($fileArr,$key2,1);
        }
        $fileName = $fileArr[0];
        $fileDir = "www.blog.com/Public/commonImage/" . $fileName;
        $img = "<img src=www.blog.com/Public/commonImage/sky.jpg />";
        echo $img;
    }
}